<% @settings.each do |setting| %>
  <%= render :file => 'users/_portalet_in_show.html', :locals => { :setting => setting} %>
<% end %>
<script type="text/javascript" charset="utf-8">
  Sortable.destroy('left_portalets');
  Sortable.destroy('mid_portalets');
  Sortable.destroy('right_portalets');
  Sortable.create('left_portalets',
    {
      tag: 'div',
      only: 'portalet', 
      overlap: 'vertical', 
      constraint: false,
      dropOnEmpty:true,
      containment:['left_portalets','mid_portalets','right_portalets'],
      onUpdate: function(one) {
        update_portalets_layout();
      }
    });
  Sortable.create('mid_portalets',
    {
      tag: 'div',
      only: 'portalet', 
      overlap: 'vertical', 
      constraint: false,
      dropOnEmpty:true,
      containment:['left_portalets','mid_portalets','right_portalets'],
      onUpdate: function(one) {
        update_portalets_layout();
      }
    });
  Sortable.create('right_portalets',
    {
      tag: 'div',
      only: 'portalet', 
      overlap: 'vertical', 
      constraint: false,
      dropOnEmpty:true,
      containment:['left_portalets','mid_portalets','right_portalets'],
      onUpdate: function(one) {
        update_portalets_layout();
      }
    });
</script>